/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.contract.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.contract.dto.ContractOrderCloseDTO;
import com.pig4cloud.pigx.contract.dto.ContractOrderCloseMarketDTO;
import com.pig4cloud.pigx.contract.dto.ContractOrderOpenDTO;
import com.pig4cloud.pigx.contract.dto.ContractRobotPlaceOrderDTO;
import com.pig4cloud.pigx.contract.entity.ContractOrder;

import java.util.List;

/**
 * 订单表
 *
 * @since 2022-08-11 10:08:11
 */
public interface ContractOrderService extends IService<ContractOrder> {

    /**
     * 开仓
     *
     * @param dto dto
     * @since 2022/8/16 18:08
     */
    void open(ContractOrderOpenDTO dto);

    /**
     * 平仓
     *
     * @param dto dto
     * @since 2022/9/6 14:38
     */
    void close(ContractOrderCloseDTO dto);

    /**
     * 市价全平接口
     *
     * @param dto dto
     * @since 2023/2/28 15:24
     */
    void closeMarket(ContractOrderCloseMarketDTO dto);

    /**
     * 市价全平
     *
     * @since 2022/9/6 18:37
     */
    void closeAll();

    /**
     * 撤销单个订单
     *
     * @param id id
     * @since 2022/8/25 11:26
     */
    void cancel(Long id);

    /**
     * 撤销当前用户全部订单
     *
     * @since 2022/9/3 21:40
     */
    void cancelAll();

    /**
     * 获取交易用户量
     *
     * @return
     */
    Integer getTransactionUser();

    /**
     * 批量新增订单-kLine机器人
     *
     * @param dtoList dtoList
     * @since 2022/8/31 14:22
     */
    void newOrderMultiRobotKLine(List<ContractRobotPlaceOrderDTO> dtoList);
}
